package net.sky.oa.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 投票选项员工表
 * TalVoteoptionsUser. @author hond
 */
@Entity
@Table(name = "TAL_VOTEOPTIONS_USER")//投票选项员工表
public class TalVoteoptionsUser implements java.io.Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields

	protected Long id;
	private Integer votecount;       //投票数
	private Integer status;          //状态
	private TalVote vote;            //投票id
	private TalVoteoptions voteoptions;//投票选项id
	private SysEmployee user;       //员工id

	// Constructors

	/** default constructor */
	public TalVoteoptionsUser() {
	}
	
	@Id
    @Column(name = "ID", unique = true, nullable = false)
	@SequenceGenerator(name="SQ_TALVOTEOPTIONSUSER_ID",sequenceName="SQ_TALVOTEOPTIONSUSER_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_TALVOTEOPTIONSUSER_ID")
	public Long getId() {
        return id;
    }

    public void setId(Long id){
    	this.id = id;
    }
	
	/** minimal constructor */
	public TalVoteoptionsUser(Long id) {
		this.id = id;
	}

	@Column(name = "VOTECOUNT", precision = 5, scale = 0)
	public Integer getVotecount() {
		return this.votecount;
	}

	public void setVotecount(Integer votecount) {
		this.votecount = votecount;
	}

	@Column(name = "STATUS", precision = 2, scale = 0)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "VOTE_ID")
	public TalVote getVote() {
		return this.vote;
	}
	
	public void setVote(TalVote vote) {
		this.vote = vote;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "VOTEOPTIONS_ID")
	public TalVoteoptions getVoteoptions() {
		return this.voteoptions;
	}

	public void setVoteoptions(TalVoteoptions voteoptions) {
		this.voteoptions = voteoptions;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "USER_ID")
	public SysEmployee getUser() {
		return this.user;
	}

	public void setUser(SysEmployee user) {
		this.user = user;
	}

}